Script Restoration BIPs: fix OP_RIGHT definition, clarify and adjust costing with wordspan notation, UPSHIFT, CLTV/CSV, final success-check#2204
Conversation
- Apply BIP-0440 wordspan notation to numeric and bitvector costs. - Define OP_RIGHT as rightmost-byte extraction with bounded copying cost. - Clarify OP_UPSHIFT, CLTV/CSV, and final success-check costs.
jonatack
left a comment
There was a problem hiding this comment.
I don't see any obvious errors in this change.
Are you waiting for review from anyone, or do you plan to send a mail list post to discuss?
|
|
||
| ==Changelog== | ||
|
|
||
| * 0.2.1: 2026-06-15: define wordspan notation and clarify byte-length versus word-span costs. |
There was a problem hiding this comment.
It may not matter, but in both changelog additions in this pull, the date is two weeks ago.
There was a problem hiding this comment.
Thanks for reviewing!
I don't think the changes are substantial enough to provide value for the mailing list, the OP_RIGHT definition was simply a mistake it seems, it now corresponds to the historical and the more natural semantics. I would give some time for @rustyrussell to take a look at the diff, but otherwise fine from my side.
There was a problem hiding this comment.
Are you still waiting for @rustyrussell to take a look, or is this ready to go?
There was a problem hiding this comment.
Well he seems to be unresponsive so good to merge from my side.
| "((length(B) + 7) / 8) * 8", as the multiplication below makes the | ||
| difference of that from the simple "length(B)" significant. | ||
| We increase the operand lengths to the next word boundary for the word-span | ||
| loops, using <code>wordspan(n)</code> from [[bip-0440.mediawiki|BIP440]], as |
There was a problem hiding this comment.
Nano-consistency-nit: BIP440 speaks of <code>wordspan(X)</code>, while this line calls it <code>wordspan(n)</code>.
BIP-0440: clarify wordspan costs
BIP-0441: update wordspan costs and fix OP_RIGHT
Apply BIP-0440 wordspan notation to numeric and bitvector costs.
Define OP_RIGHT as rightmost-byte extraction with bounded copying cost.
Clarify OP_UPSHIFT, CLTV/CSV, and final success-check costs.